﻿<Page x:Class="CustomControl.ThenPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:CustomControl"
	  xmlns:scm="clr-namespace:System.ComponentModel;assembly=System"
      mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="300"
      Title="ThenPage">

    <Grid>
		<Grid.Resources>
			<local:ImagePathConverter x:Key="imagePathConverter"></local:ImagePathConverter>
		</Grid.Resources>
		<Grid.RowDefinitions>
			<RowDefinition Height="30"></RowDefinition>
			<RowDefinition Height="*"></RowDefinition>
		</Grid.RowDefinitions>
		
		<DockPanel Grid.Row="0" Height="30" HorizontalAlignment="Stretch" LastChildFill="False">
			<TextBox x:Name="searchTextBox" Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}" DockPanel.Dock="Right" Width="200"></TextBox>
			<TextBlock Text="Search: " DockPanel.Dock="Right" TextAlignment="Center" ></TextBlock>
		</DockPanel>
		
		<ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemsSource="{Binding FilteredThenItems}" Grid.Row="1" >
			<ListView.ItemsPanel>
				<ItemsPanelTemplate>
					<WrapPanel Orientation="Horizontal" />
				</ItemsPanelTemplate>
			</ListView.ItemsPanel>
			<ListView.ItemTemplate>
				<DataTemplate>
					<Grid Width="180">
						<Grid.RowDefinitions>
							<RowDefinition Height="150"></RowDefinition>
							<RowDefinition Height="30"></RowDefinition>
						</Grid.RowDefinitions>
						<Image Source="{Binding Path=Icon, Converter={StaticResource imagePathConverter}}" Grid.Row="0" Width="150" Height="150" StretchDirection="Both"></Image>
						<TextBlock Grid.Row="1" Text="{Binding Title}" Height="30"></TextBlock>
					</Grid>
				</DataTemplate>
			</ListView.ItemTemplate>
		</ListView>

	

	</Grid>
</Page>
